/*
 * Copyright 2013 Alibaba.com All right reserved. This software is the
 * confidential and proprietary information of Alibaba.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with Alibaba.com.
 */
package com.yunos.tv.common.util;


import java.io.IOException;
import java.util.concurrent.TimeoutException;

import net.rubyeye.xmemcached.MemcachedClient;
import net.rubyeye.xmemcached.MemcachedClientBuilder;
import net.rubyeye.xmemcached.XMemcachedClientBuilder;
import net.rubyeye.xmemcached.exception.MemcachedException;
import net.rubyeye.xmemcached.utils.AddrUtil;

/**
 * 类XMemcachedDemo.java的实现描述：TODO 类实现描述
 * @author riqi 2013-7-10 下午10:20:22
 */
public class XMemcachedDemo {

    /**
     * @param args
     * @throws IOException
     * @throws MemcachedException
     * @throws InterruptedException
     * @throws TimeoutException
     */
    public static void main(String[] args) throws IOException, TimeoutException, InterruptedException, MemcachedException {
        // TODO Auto-generated method stub
        MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses("127.0.0.1:11211"));
        MemcachedClient mc = builder.build();

        mc.set("username", 36500, "liuriqi");
        System.out.println(mc.get("username"));
    }

}
